Page({
  data: {
    repairList: [],
  },
  onShow() {
    this.getRepairList()
  },
  async getRepairList() {
    const {
      code,
      data: { rows: repairList },
    } = await wx.http.get('/repair')
    if (code !== 10000) return wx.utils.toast()
    this.setData({
      repairList,
    })
  },
  goDetail() {
    wx.navigateTo({
      url: '/repair_pkg/pages/detail/index',
    })
  },
  addRepair() {
    wx.navigateTo({
      url: '/repair_pkg/pages/form/index',
    })
  },
})
